<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no, user-scalable=no">
		<script>
			var designW = 750,
				designH = 1346;
			var windowW = window.innerWidth,
				windowH = window.innerHeight;
			var scaleX = windowW / designW,
				scaleY = windowH / designH;
			var scale = Math.min(scaleX, scaleY);
			// var htmlEle = document.querySelector('html');
			// htmlEle.style.transform = 'scale(' + scale + ')';
			var metaTags = document.getElementsByTagName('meta');
			for (var i = 0; i < metaTags.length; i++) {
				// 判断当前元素是否为 viewport 相关的 meta 标签
				if (metaTags[i].getAttribute("name") === "viewport") {
					// 设置新的 initial-scale 值
					metaTags[i].setAttribute(
						"content",
						"width=device-width, shrink-to-fit=no, user-scalable=no, initial-scale=" + scale
					);
					break; // 只需修改第一个符合条件的 meta 标签，因此跳出循环
				}
			}
		</script>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="renderer" content="webkit">
		<title>联通大流量卡申领</title>
		<meta name="description" content="联通大流量卡申领" />
		<meta name="keywords" content="" />
		<style>
			body {
				margin: 0;
				background: #2AB2FE;
				display: flex;
				flex-direction: column;
				align-items: center;
			}

			.mainBox {
				width: 100%;
				max-width: 750px;
				display: flex;
				flex-direction: column;
				align-items: center;
			}

			.mainBox .topBox {
				width: 100%;
				position: relative;
			}

			.mainBox .topBox .topTxt {
				width: 60%;
				position: absolute;
				top: 16px;
				left: 20%;
				font-weight: 400;
				font-size: 24px;
				color: #FFFFFF;
				text-align: center;
			}

			.mainBox .addrBox {
				padding: 36px;
				width: calc(100% - 72px);
				background: #FFFFFF;
				border-radius: 24px;
				display: flex;
				flex-direction: column;
			}

			.mainBox .addrBox .addrTitle {
				margin-bottom: 20px;
				width: 100%;
				font-weight: 500;
				font-size: 32px;
				color: #202020;
			}

			.mainBox .addrBox .addrRow {
				padding: 20px 0;
				width: 100%;
				height: 48px;
				border-bottom: 1px solid #F0F0F0;
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				align-items: center;
			}

			.mainBox .addrBox .addrRow .rowName {
				width: 128px;
				font-weight: 400;
				font-size: 26px;
				color: #545458;
			}

			.mainBox .addrBox .addrRow .rowInput {
				width: calc(100% - 128px);
				height: 100%;
				position: relative;
			}

			.mainBox .addrBox .addrRow .rowInput>input {
				padding: 0 10px;
				width: calc(100% - 20px);
				height: 100%;
				border: none;
				font-weight: 400;
				font-size: 26px;
			}

			.mainBox .addrBox .addrRow .rowInput>input:focus,
			.mainBox .addrBox .addrRow .rowInput>input:active {
				border: none;
			}

			.mainBox .addrBox .addrRow .rowRight:after {
				content: "";
				position: absolute;
				width: 15px;
				height: 15px;
				right: 10px;
				top: 15px;
				border: 1px solid #888788;
				border-left-color: transparent;
				border-bottom-color: transparent;
				transform: rotate(45deg);
			}

			.mainBox .addrBox .addrBtn {
				margin: 30px 30px 0;
			}

			.mainBox .addrBox .addrBtn>button {
				width: 100%;
				padding: 0;
				margin: 0;
				border: none;
				background: transparent;
			}

			.mainBox .addrBox .addrBtn>button:active>img {
				opacity: 0.8;
			}

			.mainBox .stepBox {
				margin: 32px;
				padding: 30px 12px;
				width: calc(100% - 64px - 24px);
				background: #FFFFFF;
				border-radius: 24px;
				overflow: hidden;
				display: flex;
				flex-direction: column;
			}

			.mainBox .stepBox .stepTitle {
				margin-top: 36px;
				padding: 0 20px;
				font-weight: bold;
				font-size: 28px;
				color: #202020;
			}

			.mainBox .stepBox .stepTitle .stepText {
				margin-top: 24px;
				margin-bottom: 24px;
				padding: 0 20px;
				font-weight: 400;
				font-size: 24px;
				color: #545458;
				line-height: 44px;
			}


			.weui-picker-container,
			.weui-picker-overlay {
				width: 100%;
				height: 100%;
				background: rgba(0, 0, 0, 0.3);
			}

			.weui-picker-modal {
				height: 600px;
			}

			.toolbar .toolbar-inner {
				height: 80px;
			}

			.toolbar .title {
				font-size: 30px;
				line-height: 80px;
				margin: 0;
			}

			.toolbar .picker-button {
				font-size: 30px;
				font-weight: bold;
				line-height: 80px;
				padding: 0 30px;
				text-decoration: none;
			}

			.weui-picker-modal .picker-modal-inner {
				height: 520px;
			}

			.weui-picker-modal .picker-items {
				-webkit-mask-box-image: unset !important;
			}

			.city-picker .picker-items-col {
				max-width: 33%;
			}

			.weui-picker-modal .picker-item {
				height: 48px;
				text-align: center;
				font-size: 28px;
				line-height: 48px;
			}

			.weui-picker-modal .picker-item.picker-selected {
				transform: scale(1.2);
			}

			.weui-picker-modal .picker-center-highlight {
				height: 48px;
				line-height: 48px;
				margin-top: -24px;
			}
		</style>
	</head>
	<body>
		<div class="mainBox">
			<div class="topBox">
				<img src="./static/top.jpg" width="100%" alt="5G高速大流量卡" />
				<div class="topTxt">XXX 刚刚申领成功</div>
			</div>
			<div class="addrBox">
				<div class="addrTitle">收货地址</div>
				<div class="addrRow">
					<div class="rowName">收件人:</div>
					<div class="rowInput">
						<input id="username" type="text" placeholder="请输入收件人" autoComplete="false">
					</div>
				</div>
				<div class="addrRow">
					<div class="rowName">联系方式:</div>
					<div class="rowInput">
						<input id="phone" type="tel" placeholder="请输入联系方式" autoComplete="false">
					</div>
				</div>
				<div class="addrRow">
					<div class="rowName">所在地区:</div>
					<div class="rowInput ">
						<input id="city" type='text' class="" placeholder='请输入省市区' autoComplete="false" />
					</div>
				</div>
				<div class="addrRow">
					<div class="rowName">详细地址:</div>
					<div class="rowInput">
						<input id="address" type="text" placeholder="请输入详细地址" autoComplete="false">
					</div>
				</div>
				<div class="addrBtn">
					<button type="button" class="button" id="onApply">
						<img src="./static/btn.png" width="100%" alt="立即办理" />
					</button>
				</div>
			</div>
			<div class="stepBox">
				<img src="./static/step0.jpg" width="100%" alt="在线申领激活流程" />
				<div class="stepTitle">Q：号码如何预检？</div>
				<div class="stepText">1. 您在当前页面完成流量卡办理后，系统会发放一组号码给您，您需复制该号码，并识别下方二维码进入预检页面，按下图所示勾选1、2两处勾选按钮，然后点击“立即办理”按钮进入下一步页面。
				</div>
				<img src="./static/step1.jpg" width="100%" alt="在线申领激活流程" />
				<div class="stepText">2. 您在下图页面填写/粘贴您上一步收到的号码，并按页面提示上传您的现场自拍照、身份证正反面照片、填写您的个人信息，点击“提交订单”按钮并支付完成办理。
				</div>
				<img src="./static/step2.jpg" width="100%" alt="在线申领激活流程" />
				<div class="stepTitle">Q：如何实名激活？</div>
				<div class="stepText">
					在您收到流量卡后，可微信扫描卡套上的激活二维码或点击平台(10016)发送的手机卡开户成功短信中的链接，进入实名认证页面。根据页面提示填写iccid后7位数字和身份证后6位，点击“下一步”按钮，根据提示完成视频认证即可。
				</div>
				<img src="./static/step3.jpg" width="100%" alt="在线申领激活流程" />
			</div>
		</div>
		<script src="./static/jquery-1.10.2.js"></script>
		<script>
		</script>
		<script type="text/javascript">
			let username, phone, city, adderess;
			$(document).ready(function() {
				$("#onApply").click(function() {
					console.log('onApply');
					username = document.getElementById("username").value;
					phone = document.getElementById("phone").value;
					city = document.getElementById("city").value;
					address = document.getElementById("address").value;
					onOrder();
				});
			});

			function onOrder() {
				console.log('onOrder');
				if (!username) {
					alert("请输入收件人!");
					return;
				}
				if (!phone) {
					alert("请输入联系方式!");
					return;
				}
				const regex = /^1[3-9]\d{9}$/; // 中国大陆手机号码的正则表达式
				if (!regex.test(phone)) {
					alert("请检查联系方式!");
					return;
				}
				if (!city) {
					alert("请输入省市区!");
					return;
				}
				if (!address) {
					alert("请输入详细地址!");
					return;
				}
				$.ajax({
					url: "https://chat.wokahui.com/claim/index/put_order",
					type: "POST",
					data: {
						name: username,
						tel: phone,
						province: city[0],
						city: city[1],
						county: city[2],
						address: address,
					},
					dataType: "json",
					timeout: 6000,
					beforeSend: function(xhr) {
						// 可选，发送请求前执行（如添加请求头、显示加载动画）
						console.log("准备发送请求...");
					},
					success: function(response) {
						// 必需，请求成功时执行（response 是服务器返回的数据）
						console.log("请求成功：", response);
					},
					error: function(xhr, status, error) {
						// 可选，请求失败时执行（如网络错误、服务器错误）
						console.log("请求失败：", status, error);
					},
					complete: function(xhr, status) {
						// 可选，请求完成后执行（无论成功或失败，如隐藏加载动画）
						console.log("请求结束");
					}
				});

			}

			function onPaying() {}

			function onComplete() {
				window.location.href = "file:///D:/ZhangKui/projects/high_flow_cards/complete.html";
			}

			// 获取内容
			function getContent() {
				console.log('getContent');
				var txtStyle = "font-weight: 400;font-size: 12px;color: #45485F;line-height: 18px;transform: scale(1.025);";
				var iconStyle = "width: 12px;height: 12px;margin-right: 6px;";
				var marginStyle = "margin-top: 10px;";
				var flexStyle = "display: flex;flex-direction: row;align-items: center;margin-top: 2px;";
				var html = `
				<div style="background: rgba(0, 0, 0, .35);position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size: 0;" id="my_modal">
					<div style="width: 300px;display: flex;flex-direction: column;position: absolute;left: 50%;top: 50%;transform: translate(-50%, -50%);">
						<div style="background: url('./bg1.png') no-repeat;background-size: 100% 100%;width: 300px;height: 82px;"></div>
						<div style="background: url('./bg2.png') no-repeat;background-size: 100% 100%;width: 300px;">
							<div style="margin: 0 6px;padding: 0 14px;width: calc(100% - 40px);position: relative;top: -16px;background: #fff;border-radius: 20px;">
								<div style="${txtStyle}">老用户专享好消息来啦！ </div>
								<div style="${txtStyle} ${marginStyle}">由于集团政策调整，近期部分流量卡出现被清理、限速或停用的情况，对此给您带来的不便，我们深表歉意。 </div>
								<div style="${txtStyle} ${marginStyle}">经过数月努力，我们终于为大家争取到了【联通5G高速大流量卡】！</div>
								<div style="${txtStyle} ${flexStyle}"><img src="./icon.png" alt="icon" style="${iconStyle}" />永久有效，不再担心清理、限速、停用;</div>
								<div style="${txtStyle} ${flexStyle}"><img src="./icon.png" alt="icon" style="${iconStyle}" />10010官方可查套餐与余额，真实可靠;</div>
								<div style="${txtStyle} ${flexStyle}"><img src="./icon.png" alt="icon" style="${iconStyle}" />全国通用5G流量，畅享高速网络;</div>
								<div style="${txtStyle} ${flexStyle}"><img src="./icon.png" alt="icon" style="${iconStyle}" />支持主流第三方平台充值，方便快捷。</div>
								<div style="${txtStyle} ${marginStyle}">数量有限，仅限老用户办理，每人限一张！ </div>
								<div style="${txtStyle}">抓紧机会，别再错过。</div>
							</div>
						</div>
						<div style="background: url('./bg3.png') no-repeat;background-size: 100% 100%;width: 300px;height: 25px;position: relative;top: -1px;"></div>
						<div style="width: 192px;height: 40px;background: #5D51F8;border-radius: 20px;display: flex;justify-content: center;align-items: center;font-weight: bold;font-size: 18px;color: #FFFFFF;cursor: pointer;box-shadow: 0 0 10px #fff;position: relative;top: -26px;left: 50%;transform: translate(-50%, 0);" onclick="onClose()">
							立即申领
						</div>
					</div>
				</div>
				`;

				$("body").append(html);

			}

			function onClose() {
				console.log('onclose')
				$("#my_modal").hide()
			}
		</script>

	</body>
</html>